//
//  ControlCenterTopView.m
//  Recycling
//
//  Created by jzd on 2018/6/1.
//  Copyright © 2018年 宋佳. All rights reserved.
//

#import "ControlCenterTopView.h"

@implementation ControlCenterTopView

-(void)awakeFromNib{
    [super awakeFromNib];
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    formatter.dateFormat = @"yyyy-MM-dd";
    NSString *date = [formatter stringFromDate:[NSDate date]];
    [self.startBut setTitle:date forState:UIControlStateNormal];
    [self.stopBut setTitle:date forState:UIControlStateNormal];
}

+(instancetype)getHeaderView{
    return  [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]lastObject];
}

- (IBAction)area:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(areaButtonOnClick:)]) {
        [self.delegate areaButtonOnClick:sender];
    }
}
- (IBAction)begin:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(startButtonOnClick:)]) {
        [self.delegate startButtonOnClick:sender];
    }
}

- (IBAction)end:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(stopButtonOnClick:)]) {
        [self.delegate stopButtonOnClick:sender];
    }
}
- (IBAction)checkOnClick:(UIButton *)sender {
    [[NSNotificationCenter defaultCenter]postNotificationName:orderManagerCheckNotification object:nil];
}
- (IBAction)selectType:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(selectTypeOnClick:)]) {
        [self.delegate selectTypeOnClick:sender];
    }
}



@end
